<?php
	/**
	 * Implementation of the "example" application.
	 * 
	 * An extremely basic example that can be used to explain the basic structure
	 * of an object in the Krome engine.	 
	 *
	 * @author     Brandon R. Stoner <brandon.stoner@gmail.com>
	 * @copyright  Copyright 2008, Monokromatic Inc.
	 * @package    Applications
	 * @subpackage Example	 	 
	 **/	 

	/**
	 * Example application
	 * 
	 * An example demonstrating the structure of an application build on the
	 * Krome engine.
	 * 
	 * @author     Brandon R. Stoner <brandon.stoner@gmail.com>
	 * @copyright  Copyright 2008, Monokromatic Inc.
	 * @package    Applications
	 * @subpackage Example	 	 	 	 	 	 	 	 
	 **/
	class CKromeExampleApplication extends IKromeApplication
	{
		/**
		 * A "friendly" name for this object.
		 * @var string
		 **/
		public  $name = 'Krome Example Application';
		private $outputObject;

		/**
		 * @see IKromeApplication::Initialize()
		 **/
		public function Initialize()
		{
			$this->outputObject = $this->GetComponentManager()->Load('krome.output');

			if ( $this->outputObject )
			{
				$this->outputObject->Write( get_class( $this ) . " Initialized...", true );
   		}
		}

		/**
		 * @see IKromeApplication::Create()
		 **/
		public function Create()
		{
			if ( $this->outputObject )
			{
				$this->outputObject->Write( get_class( $this ) . " Created...", true );
			}
		}

		/**
		 * @see IKromeApplication::Execute()
		 **/
		public function Execute()
		{
			if ( $this->outputObject )
			{
				$this->outputObject->Write( get_class( $this ) . " Executed...", true );
			}
		}

		/**
		 * @see IKromeApplication::Cleanup()
		 **/
		public function Cleanup()
		{
			if ( $this->outputObject )
			{
				$this->outputObject->Write( get_class( $this ) . " Cleaning up...", true );
			}
		}

		/**
		 * @see IKromeApplication::Destroy()
		 **/
		public function Destroy()
		{
			if ( $this->outputObject )
			{
				$this->outputObject->Write( get_class( $this ) . " Destroyed...", true );
			}
		}
	}
?>
